package com.infore.siteManagement.repository.equipment;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.infore.siteManagement.entity.equipment.EquipSampleAndProject;

@Repository
public interface IEquipSampleAndProjectRepository
		extends JpaRepository<EquipSampleAndProject, String>, JpaSpecificationExecutor<EquipSampleAndProject> {

	/** 通过仪器实例id删除仪器实例和因子中间表 **/
	@Modifying
	@Transactional
	@Query(value = "delete from EQUIP_SAMPLE_AND_PROJECT where EQUIP_SAMPLE_ID in (:ids)", nativeQuery = true)
	int delByEquipSamleIdIn(@Param("ids") List<String> ids);
}
